﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

class BillDetailsDAL
{
    DataAccess acc = new DataAccess();
    internal DataTable getBillDetailsById(int id)
    {
        SqlParameter[] paraList = new SqlParameter[1];
        paraList[0] = new SqlParameter("@Bi_ID", SqlDbType.Int);
        paraList[0].Value = id;
        return acc.executeSelect("getBillDetailsByID", paraList);       
    }

    internal bool insertBillDetails(int billID, string bouquetID, int quantity, float amount)
    {
        SqlParameter[] paraList = new SqlParameter[4];
        paraList[0] = new SqlParameter("@Bi_ID", SqlDbType.Int);
        paraList[0].Value = billID;
        paraList[1] = new SqlParameter("@B_ID", SqlDbType.NVarChar, 50);
        paraList[1].Value = bouquetID;
        paraList[2] = new SqlParameter("@BiD_Number", SqlDbType.Int);
        paraList[2].Value = quantity;
        paraList[3] = new SqlParameter("@BiD_Amount", SqlDbType.Float);
        paraList[3].Value = amount;
        int check = acc.executeModifier("InsertBillDetails", paraList);
        if (check > 0)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
}
